package com.ruoyi.common.enums;

/**
 * 用户状态
 * 
 * @author ruoyi
 */
public enum SignStatus
{
    ON_TIME(0L, "准时"),
    LATE(1L, "迟到"),
    MAKE_UP_SIGN(2L, "补签"),
    ABSENT(3L, "旷课"),
    ASK_FOR_LEAVE(4L, "请假"),
    NOT_SIGNED(5L, "未签");

    private final Long code;
    private final String info;

    SignStatus(Long code, String info) {
        this.code = code;
        this.info = info;
    }

    public Long getCode() {
        return code;
    }

    public String getInfo() {
        return info;
    }

    public static SignStatus getStatusByCode(Long code) {
        for (SignStatus status : SignStatus.values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return null;
    }
}
